package com.pn.service.impl;

import com.pn.entity.Brand;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.pn.mapper.BrandMapper;
import com.pn.service.BrandService;

import java.util.List;

@CacheConfig(cacheNames = "com.pn.service.impl.BrandServiceImpl")
@Service
public class BrandServiceImpl implements BrandService{

    @Resource
    private BrandMapper brandMapper;

    @Cacheable(key = "'all:brand'")
    @Override
    public List<Brand> findAllBrand() {
        return brandMapper.selectAllBrand();
    }
}
